//
//  ChoosCollectionViewCell.m
//  SheShiDu
//
//  Created by 单剑秋 on 16/6/18.
//  Copyright © 2016年 单剑秋. All rights reserved.
//

#import "ChoosCollectionViewCell.h"

@implementation ChoosCollectionViewCell

- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        self.backgroundColor = [UIColor colorWithRed:35 / 255.0 green:195 / 255.0 blue:183 / 255.0 alpha:1];
        self.titleLabel = [[UILabel alloc]init];
        _titleLabel.backgroundColor = [UIColor whiteColor];
        _titleLabel.layer.masksToBounds = YES;
        _titleLabel.layer.cornerRadius = 5;
        _titleLabel.textAlignment = NSTextAlignmentCenter;
        _titleLabel.textColor = [UIColor colorWithRed:35 / 255.0 green:195 / 255.0 blue:183 / 255.0 alpha:1];
        [self.contentView addSubview:_titleLabel];
    }
    return self;
}

- (void)applyLayoutAttributes:(UICollectionViewLayoutAttributes *)layoutAttributes
{
    [super applyLayoutAttributes:layoutAttributes];
    _titleLabel.frame = CGRectMake(1, 1, layoutAttributes.size.width - 2, layoutAttributes.size.height - 2);
}

@end
